3.10.35 \(\int \frac {1}{(a+i a \tan (e+f x)) (c-i c \tan (e+f x))^2} \, dx\) [935]

Optimal. Leaf size=101 \[ \frac {3 x}{8 a c^2}-\frac {i}{8 a f (c-i c \tan (e+f x))^2}-\frac {i}{4 a f \left (c^2-i c^2 \tan (e+f x)\right )}+\frac {i}{8 a f \left (c^2+i c^2 \tan (e+f x)\right )} \]

[Out]

3/8*x/a/c^2-1/8*I/a/f/(c-I*c*tan(f*x+e))^2-1/4*I/a/f/(c^2-I*c^2*tan(f*x+e))+1/8*I/a/f/(c^2+I*c^2*tan(f*x+e))

________________________________________________________________________________________

Rubi [A]
time = 0.11, antiderivative size = 101, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.129, Rules used = {3603, 3568, 46, 212} \begin {gather*} -\frac {i}{4 a f \left (c^2-i c^2 \tan (e+f x)\right )}+\frac {i}{8 a f \left (c^2+i c^2 \tan (e+f x)\right )}+\frac {3 x}{8 a c^2}-\frac {i}{8 a f (c-i c \tan (e+f x))^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[1/((a + I*a*Tan[e + f*x])*(c - I*c*Tan[e + f*x])^2),x]

[Out]

(3*x)/(8*a*c^2) - (I/8)/(a*f*(c - I*c*Tan[e + f*x])^2) - (I/4)/(a*f*(c^2 - I*c^2*Tan[e + f*x])) + (I/8)/(a*f*(
c^2 + I*c^2*Tan[e + f*x]))

Rule 46

Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*x
)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && Lt
Q[m + n + 2, 0])

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 3568

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(a^(m - 2)*b
*f), Subst[Int[(a - x)^(m/2 - 1)*(a + x)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x
] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]

Rule 3603

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Di
st[a^m*c^m, Int[Sec[e + f*x]^(2*m)*(c + d*Tan[e + f*x])^(n - m), x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] &&
EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0] && IntegerQ[m] &&  !(IGtQ[n, 0] && (LtQ[m, 0] || GtQ[m, n]))

Rubi steps

\begin {align*} \int \frac {1}{(a+i a \tan (e+f x)) (c-i c \tan (e+f x))^2} \, dx &=\frac {\int \frac {\cos ^2(e+f x)}{c-i c \tan (e+f x)} \, dx}{a c}\\ &=\frac {\left (i c^2\right ) \text {Subst}\left (\int \frac {1}{(c-x)^2 (c+x)^3} \, dx,x,-i c \tan (e+f x)\right )}{a f}\\ &=\frac {\left (i c^2\right ) \text {Subst}\left (\int \left (\frac {1}{8 c^3 (c-x)^2}+\frac {1}{4 c^2 (c+x)^3}+\frac {1}{4 c^3 (c+x)^2}+\frac {3}{8 c^3 \left (c^2-x^2\right )}\right ) \, dx,x,-i c \tan (e+f x)\right )}{a f}\\ &=-\frac {i}{8 a f (c-i c \tan (e+f x))^2}-\frac {i}{4 a f \left (c^2-i c^2 \tan (e+f x)\right )}+\frac {i}{8 a f \left (c^2+i c^2 \tan (e+f x)\right )}+\frac {(3 i) \text {Subst}\left (\int \frac {1}{c^2-x^2} \, dx,x,-i c \tan (e+f x)\right )}{8 a c f}\\ &=\frac {3 x}{8 a c^2}-\frac {i}{8 a f (c-i c \tan (e+f x))^2}-\frac {i}{4 a f \left (c^2-i c^2 \tan (e+f x)\right )}+\frac {i}{8 a f \left (c^2+i c^2 \tan (e+f x)\right )}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.66, size = 102, normalized size = 1.01 \begin {gather*} -\frac {(\cos (2 (e+f x))+i \sin (2 (e+f x))) (7+12 i f x-2 \cos (2 (e+f x))+3 i \sec (e+f x) \sin (3 (e+f x))+6 i \tan (e+f x)+12 f x \tan (e+f x))}{32 a c^2 f (-i+\tan (e+f x))} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[1/((a + I*a*Tan[e + f*x])*(c - I*c*Tan[e + f*x])^2),x]

[Out]

-1/32*((Cos[2*(e + f*x)] + I*Sin[2*(e + f*x)])*(7 + (12*I)*f*x - 2*Cos[2*(e + f*x)] + (3*I)*Sec[e + f*x]*Sin[3
*(e + f*x)] + (6*I)*Tan[e + f*x] + 12*f*x*Tan[e + f*x]))/(a*c^2*f*(-I + Tan[e + f*x]))

________________________________________________________________________________________

Maple [A]
time = 0.17, size = 78, normalized size = 0.77

method result size
risch \(\frac {3 x}{8 a \,c^{2}}-\frac {i {\mathrm e}^{4 i \left (f x +e \right )}}{32 c^{2} a f}-\frac {i \cos \left (2 f x +2 e \right )}{8 c^{2} a f}+\frac {\sin \left (2 f x +2 e \right )}{4 c^{2} a f}\) \(73\)
derivativedivides \(\frac {-\frac {3 i \ln \left (\tan \left (f x +e \right )-i\right )}{16}+\frac {1}{8 \tan \left (f x +e \right )-8 i}+\frac {i}{8 \left (\tan \left (f x +e \right )+i\right )^{2}}+\frac {3 i \ln \left (\tan \left (f x +e \right )+i\right )}{16}+\frac {1}{4 \tan \left (f x +e \right )+4 i}}{f a \,c^{2}}\) \(78\)
default \(\frac {-\frac {3 i \ln \left (\tan \left (f x +e \right )-i\right )}{16}+\frac {1}{8 \tan \left (f x +e \right )-8 i}+\frac {i}{8 \left (\tan \left (f x +e \right )+i\right )^{2}}+\frac {3 i \ln \left (\tan \left (f x +e \right )+i\right )}{16}+\frac {1}{4 \tan \left (f x +e \right )+4 i}}{f a \,c^{2}}\) \(78\)
norman \(\frac {\frac {3 x}{8 a c}+\frac {5 \tan \left (f x +e \right )}{8 a c f}+\frac {3 \left (\tan ^{3}\left (f x +e \right )\right )}{8 a c f}+\frac {3 x \left (\tan ^{2}\left (f x +e \right )\right )}{4 a c}+\frac {3 x \left (\tan ^{4}\left (f x +e \right )\right )}{8 a c}-\frac {i}{4 a c f}}{\left (1+\tan ^{2}\left (f x +e \right )\right )^{2} c}\) \(109\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(a+I*a*tan(f*x+e))/(c-I*c*tan(f*x+e))^2,x,method=_RETURNVERBOSE)

[Out]

1/f/a/c^2*(-3/16*I*ln(tan(f*x+e)-I)+1/8/(tan(f*x+e)-I)+1/8*I/(tan(f*x+e)+I)^2+3/16*I*ln(tan(f*x+e)+I)+1/4/(tan
(f*x+e)+I))

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+I*a*tan(f*x+e))/(c-I*c*tan(f*x+e))^2,x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: Error executing code in Maxima: expt: undefined: 0 to a negative e
xponent.

________________________________________________________________________________________

Fricas [A]
time = 1.05, size = 61, normalized size = 0.60 \begin {gather*} \frac {{\left (12 \, f x e^{\left (2 i \, f x + 2 i \, e\right )} - i \, e^{\left (6 i \, f x + 6 i \, e\right )} - 6 i \, e^{\left (4 i \, f x + 4 i \, e\right )} + 2 i\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{32 \, a c^{2} f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+I*a*tan(f*x+e))/(c-I*c*tan(f*x+e))^2,x, algorithm="fricas")

[Out]

1/32*(12*f*x*e^(2*I*f*x + 2*I*e) - I*e^(6*I*f*x + 6*I*e) - 6*I*e^(4*I*f*x + 4*I*e) + 2*I)*e^(-2*I*f*x - 2*I*e)
/(a*c^2*f)

________________________________________________________________________________________

Sympy [A]
time = 0.19, size = 172, normalized size = 1.70 \begin {gather*} \begin {cases} \frac {\left (- 256 i a^{2} c^{4} f^{2} e^{6 i e} e^{4 i f x} - 1536 i a^{2} c^{4} f^{2} e^{4 i e} e^{2 i f x} + 512 i a^{2} c^{4} f^{2} e^{- 2 i f x}\right ) e^{- 2 i e}}{8192 a^{3} c^{6} f^{3}} & \text {for}\: a^{3} c^{6} f^{3} e^{2 i e} \neq 0 \\x \left (\frac {\left (e^{6 i e} + 3 e^{4 i e} + 3 e^{2 i e} + 1\right ) e^{- 2 i e}}{8 a c^{2}} - \frac {3}{8 a c^{2}}\right ) & \text {otherwise} \end {cases} + \frac {3 x}{8 a c^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+I*a*tan(f*x+e))/(c-I*c*tan(f*x+e))**2,x)

[Out]

Piecewise(((-256*I*a**2*c**4*f**2*exp(6*I*e)*exp(4*I*f*x) - 1536*I*a**2*c**4*f**2*exp(4*I*e)*exp(2*I*f*x) + 51
2*I*a**2*c**4*f**2*exp(-2*I*f*x))*exp(-2*I*e)/(8192*a**3*c**6*f**3), Ne(a**3*c**6*f**3*exp(2*I*e), 0)), (x*((e
xp(6*I*e) + 3*exp(4*I*e) + 3*exp(2*I*e) + 1)*exp(-2*I*e)/(8*a*c**2) - 3/(8*a*c**2)), True)) + 3*x/(8*a*c**2)

________________________________________________________________________________________

Giac [A]
time = 0.54, size = 118, normalized size = 1.17 \begin {gather*} -\frac {-\frac {6 i \, \log \left (-i \, \tan \left (f x + e\right ) + 1\right )}{a c^{2}} + \frac {6 i \, \log \left (-i \, \tan \left (f x + e\right ) - 1\right )}{a c^{2}} + \frac {2 \, {\left (3 \, \tan \left (f x + e\right ) - 5 i\right )}}{a c^{2} {\left (i \, \tan \left (f x + e\right ) + 1\right )}} + \frac {9 i \, \tan \left (f x + e\right )^{2} - 26 \, \tan \left (f x + e\right ) - 21 i}{a c^{2} {\left (\tan \left (f x + e\right ) + i\right )}^{2}}}{32 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+I*a*tan(f*x+e))/(c-I*c*tan(f*x+e))^2,x, algorithm="giac")

[Out]

-1/32*(-6*I*log(-I*tan(f*x + e) + 1)/(a*c^2) + 6*I*log(-I*tan(f*x + e) - 1)/(a*c^2) + 2*(3*tan(f*x + e) - 5*I)
/(a*c^2*(I*tan(f*x + e) + 1)) + (9*I*tan(f*x + e)^2 - 26*tan(f*x + e) - 21*I)/(a*c^2*(tan(f*x + e) + I)^2))/f

________________________________________________________________________________________

Mupad [B]
time = 4.88, size = 66, normalized size = 0.65 \begin {gather*} \frac {3\,x}{8\,a\,c^2}+\frac {\frac {{\mathrm {tan}\left (e+f\,x\right )}^2\,3{}\mathrm {i}}{8}-\frac {3\,\mathrm {tan}\left (e+f\,x\right )}{8}+\frac {1}{4}{}\mathrm {i}}{a\,c^2\,f\,\left (1+\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )\,{\left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )}^2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/((a + a*tan(e + f*x)*1i)*(c - c*tan(e + f*x)*1i)^2),x)

[Out]

(3*x)/(8*a*c^2) + ((tan(e + f*x)^2*3i)/8 - (3*tan(e + f*x))/8 + 1i/4)/(a*c^2*f*(tan(e + f*x)*1i + 1)*(tan(e +
f*x) + 1i)^2)

________________________________________________________________________________________